const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const HotModuleReplacementPlugin = require('webpack/lib/HotModuleReplacementPlugin')
module.exports = {
    mode: 'development',
    entry:'./src/index.js',
    devtool:false,
    output:{
        filename: '[name].js',
        path: path.resolve(__dirname,'dist'),
        // hotUpdateGlobal: 'webpackHotUpdate',
        //output path成为默认的静态文件服务器
    },
    devServer:{
        hot:true,
        port:9000,
        //除了打包后的资源外的额外的静态文件器
        // contentBase: path.resolve(__dirname,'static'),
    },
    plugins:[
        new HtmlWebpackPlugin({
            template: './public/index.html'
        }),
        new HotModuleReplacementPlugin(), // devServer hot为 ture不需要写用这个插件
 
    ] 
}